package com.hxb.notificationdemo;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.Button;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.hxb.notificationdemo.notification.NotificationAction;
import com.hxb.notificationdemo.notification.NotificationData;
import com.hxb.notificationdemo.notification.StatusBarNotificationUtil;

@Route(path = "/hxb/main", name = "主页面")
public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button but = findViewById(R.id.but);
        but.setOnClickListener(v -> {
            //--------参数
            NotificationData notificationData = new NotificationData(NotificationAction.jump);
            notificationData.setPath("/hxb/test");
            //---------参数

            final StatusBarNotificationUtil statusBarNotificationUtil = new StatusBarNotificationUtil();
            statusBarNotificationUtil.setNotificationPriority(StatusBarNotificationUtil.PriorityEnum.UNSPECIFIED);
            statusBarNotificationUtil.showNotification(BaseApplication.getContext(),
                    "您有一条新消息",
                    "hmp",
                    R.mipmap.ic_launcher,
                    Declare.NotificationCode,
                    false,
                    false,
                    notificationData);
            Declare.NotificationCode++;
        });
    }
}